export function fullscreen(element: HTMLElement) {
  if (!document.fullscreenEnabled) {
    return Promise.reject(new Error("全屏模式被禁用"));
  }
  let result = element.requestFullscreen();
  return result || Promise.reject(new Error("不支持全屏"));
}

export function cancelFullscreen() {
  if (document.exitFullscreen) {
    document.exitFullscreen();
  }
}

export function getAssetsImage(name: string) {
  return new URL(`../assets/image/${name}`, import.meta.url).href
}